package com.chj;

import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.ReferenceConfig;
import com.alibaba.dubbo.config.RegistryConfig;
import com.chj.entity.OrderEntiry;
import com.chj.entity.UserEntiry;
import com.chj.service.OrderService;
import com.chj.service.UserService;
import com.chj.service.UserServiceApi;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.IOException;


/**
 * xml的方式调用
 */
public class ConsumerAppXml {
    public static void main(String[] args) throws IOException {
        ClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext("dubbo.xml");
        context.start();
        UserService userService = (UserService) context.getBean("userService");
        OrderService orderService = (OrderService) context.getBean("orderService");
        UserEntiry userEntiry = userService.getDetail("2");
        OrderEntiry orderEntiry = orderService.getDetail("2");
        System.out.println(userEntiry.getName());
        System.out.println(orderEntiry.getMoney());
        System.in.read();
    }
}
